/*************************************************
 * HISTORY:                                      *
 *	06/22/2020 pyx : Created.                    *
 *	06/01/2022 pyx : Edited.                     *
=================================================*/

#include "DADumperConnector.h"
#include "DAType.h"

#include <string>
#include <vector>
#include <iostream>
#include <fstream>

int main(int argc, const char **argv)
{

	if (argc == 2)
	{ // DATransformer /workspace
		std::string directory = argv[1];
		if (directory[0] != '/')
		{
			std::cout << "Need absolute path (only support unix)" << std::endl;
			exit(-1);
		}

		std::cout << "connecting MySQL database..." << std::endl;
		Connector *c = new Connector(directory);
		delete c;
	}
	else if (argc == 3)
	{
		// DATransformer /workspace /vectors.txt
		std::string directory = argv[1];
		if (directory[0] != '/')
		{
			std::cout << "Need absolute path (only support unix)" << std::endl;
			exit(-1);
		}
		std::string vectorsfile = argv[2];
		if (vectorsfile[0] != '/')
		{
			std::cout << "Need absolute path (only support unix)" << std::endl;
			exit(-1);
		}
		std::cout << "connecting MySQL database..." << std::endl;
		Connector *c = new Connector(directory, vectorsfile);
		delete c;
	}
	else
	{
		std::cout << "Wrong Parameter!" << std::endl;
		exit(-1);
	}

	return 0;
}
